package com.yudean.esb.service.impl.mds;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yudean.esb.domain.erp.IdsPmProAppr;
import com.yudean.esb.mapper.mds.IdsPmProApprMapper;
import com.yudean.esb.service.IdsPmProApprService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class IdsPmProApprServiceImpl extends ServiceImpl<IdsPmProApprMapper, IdsPmProAppr> implements IdsPmProApprService {
    @Resource
    private IdsPmProApprMapper idsPmProApprMapper;

    @Override
    public IdsPmProAppr selectByMap(Map<String, Object> map) {
        QueryWrapper<IdsPmProAppr> wrapper = new QueryWrapper<>();
        map.forEach(wrapper::eq);
        return idsPmProApprMapper.selectOne(wrapper);
    }

    @Override
    public int updateByMap(IdsPmProAppr idsPmProAppr,Map<String, Object> map) {
        QueryWrapper<IdsPmProAppr> wrapper = new QueryWrapper<>();
        map.forEach(wrapper::eq);
        return idsPmProApprMapper.update(idsPmProAppr, wrapper);
    }

    @Override
    public int insertObj(IdsPmProAppr idsPmProAppr) {
        return idsPmProApprMapper.insert(idsPmProAppr);
    }
}
